The reverse of the PHP array in an article, "How to sort php arrays," we introduced the sort, asort, and Ksort, which are sorted in ascending order of the array, so if you want to implement the reverse of the arrays? Here's another set of functions
The reverse of the PHP array in an article, "How to sort php arrays," we introduced the sort, asort, and Ksort, which are sorted in ascending order of the array, so if you want to implement the reverse of the arrays? Here's another set of functions
Detailed description of the features of the PHP function arsort. You are learning the following ListingF code as an example of using the PHP function arsort :? Php $ dataarray (USUnitedStates, INIndia, DEGermany, ESSpain); arsort ($ d everyone is
The PHP arsort function is used to sort the elements in the array in descending order, if the sort succeeds returns True, otherwise returns false, this article explains the basic syntax of the Arsort function and the use of examples, the need for
Everyone is learningThe following code for listing F is an example of the use of PHP function Arsort ():
Php
$ Data Array("US" =>=> "India", "DE" => "Germany", "ES" =>"Spain"); Arsort
1PHP2 3 4 $characters=Array(' A ', ' B ', ' C ', ' d ', ' e ', ' F ');5 Arsort($characters);6 Print_r($characters);7 /*8 Array ([5] = f [4] = e [3] = + d [2] = c [1] = b [0] = a)9 */Ten One A - $numbers=Array(1,2,3,4,5,6,7,8); - Arsort($numbers);
Php arsort array sort in descending order
Arsort sorts arrays in descending order and maintains the index relationship.
Basic syntax
Bool arsort (array & $ array [, int $ sort_flags = SORT_REGULAR])
This function sorts the array in descending order.
First, the concept:1, natural sorting method: that is, according to the natural number of the size of the order, such as "10>2";2, the computer standard sorting method: is to compare by character, sort, for example "2>10" (because the first bit 2>1);
Arsort an array in descending order and maintains an indexed relationship.
Basic syntax
BOOL Arsort (array & $array [, int $sort _flags = sort_regular])
This function is sorted in descending order, and the index of the array is persisted and the
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.